package com.zyj.test.month1.day6;

/**
 * @author Yijia Zhang
 * @create 2024-04-27 22:57
 */
public class code2639 {
    public int[] findColumnWidth(int[][] grid) {
        int m = grid.length;
        if (m == 0) {
            return new int[0];
        }
        int n = grid[0].length;
        int[] res = new int[n];
        for (int j = 0; j < n; j++) {
            int max = 0;
            for (int i = 0; i < m; i++) {
                max = Math.max(max, String.valueOf(grid[i][j]).length());
            }
            res[j] = max;
        }
        return res;
    }
}
